#define LCD1602BUS P0

sbit LCD1602_RS=P2^6;
sbit LCD1602_WR=P2^5;
sbit LCD1602_EN=P2^7;

void LCD1602_Write_Cmd(unsigned char varCMD)
{
	LCD1602BUS=varCMD;
	LCD1602_WR=0;
	LCD1602_RS=0;
	LCD1602_EN=1;
	delay5us();
	LCD1602_EN=0;
	LCD1602_WR=1;
	LCD1602_RS=1;
	delay50us();
}

void LCD1602_Write_Data(unsigned char varDATA)
{
	LCD1602BUS=varDATA;
	LCD1602_WR=0;
	LCD1602_RS=1;
	LCD1602_EN=1;
	delay5us();
	LCD1602_EN=0;
	LCD1602_WR=1;
	LCD1602_RS=1;
	delay50us();
}

void LCD1602_Init()
{
	LCD1602_Write_Cmd(0x38);		//设置数据总线宽度为8位,2行,5*7点阵
	LCD1602_Write_Cmd(0x0C);		//开显示,关光标,不闪烁
	LCD1602_Write_Cmd(0x06);		//设定输入方式为增量不移位
	LCD1602_Write_Cmd(0x01);		//清屏复位
	delay1ms();
	delay1ms();
	LCD1602_Write_Cmd(0x80);
	LCD1602_Write_Data(0x54);		//T
	LCD1602_Write_Data(0x28);		//(
	LCD1602_Write_Data(0x6E);		//n
	LCD1602_Write_Data(0x6F);		//o
	LCD1602_Write_Data(0x77);		//w
	LCD1602_Write_Data(0x29);		//)
	LCD1602_Write_Data(0x3A);		//:
	LCD1602_Write_Cmd(0x8B);
	LCD1602_Write_Data(0xDF);		//°
	LCD1602_Write_Data(0x43);		//C
	LCD1602_Write_Cmd(0xC0);
	LCD1602_Write_Data(0x54);		//T
	LCD1602_Write_Data(0x28);		//(
	LCD1602_Write_Data(0x65);		//s
	LCD1602_Write_Data(0x6E);		//t
	LCD1602_Write_Data(0x64);		//o
	LCD1602_Write_Data(0x29);		//)
	LCD1602_Write_Data(0x3A);		//:
	LCD1602_Write_Cmd(0xCB);
	LCD1602_Write_Data(0xDF);		//°
	LCD1602_Write_Data(0x43);		//C
}
